A database is a collection of related records stored on a computer system. Often times, these records are accessible to multiple users (both people and computer programs) at the same time. A data integrity problem occurs when multiple users are concurrently attempting to access or modify a particular database record. If a database report is run while users are executing update transactions on records in the database, then the update transactions may cause the data to change, resulting in inconsistencies in the database report. For example, if database records are used to represent accounts at a bank and a user has multiple accounts at the bank, when the user transfers funds from one account to another account, a subtraction of funds from one record and an addition of funds to the other record must occur. If the bank is running an account balance report at the same time the user is transferring funds, and the report reads one record before the subtraction occurs and the other record after the addition occurs, then the user's total account value will be wrong.
There are several prior art solutions to this problem. One solution is to simply lock the database and not allow any updates while the report is being generated. This solution is inadequate because it limits the accessibility of the records in the database. Another prior art solution is to record the start time of the report and the time of each record's last update. If the report encounters a record with an update time that is after the start time of the report, then the report aborts and starts over. This solution is undesirable because it restricts reports to being generated when there is no activity in the database. Yet another solution maintains versions of records. A version is a copy of a record made immediately before the start of a modification of that record. Versions of records are maintained in case the record itself is inaccessible for some reason (e.g., someone is currently editing the record). Thus, a report may run to completion because the report may access a version instead of the record. One disadvantage of this solution is that all of the versions for a record are stored with the database record. Because the number of versions a particular record may have is unbounded, the database may become too large and cause performance of the database to suffer.